package org.annoflow.policy;

import java.util.HashMap;


public class AnchoredPolicy implements PolicyType {

	@Override
	public void assess(HashMap<String, String> context) throws Exception {
		if ("network".equals(context.get("type")))
			throw new Exception();
	}

	@Override
	public boolean audit(Object o,String filterName, Class<?> methodOwner) {
		return false;
	}

	@Override
	public String getPolicyCode() {
		return "org.annoflow.policy.AnchoredPolicy.addPolicy($class);";
	}
	
	@Override
	public PolicyType generateOrigin() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public static void addPolicy(Class<?> clazz) {
		PolicyManager.addClassPolicy(clazz, new AnchoredPolicy());
	}

}
